#**************************************************
#
# Makefile pour omniORB
#
# **************************************************

SHELL           = /bin/sh

SERVER_NAME     = server
CLIENT_NAME     = client

TARGETS         = $(SERVER_NAME) \
		  $(CLIENT_NAME)

COMMON_OBJS     = DictionnarySK.o

CLIENT_OBJS     = dict_client.o dict_client_i.o

SRCS            = $(COMMON_OBJS:.o=.cc) \
		  $(CLIENT_OBJS:.o=.cc)

CLIENT_SRCS	= $(CLIENT_OBJS:.o=.cc)
COMMON_SRCS	= $(COMMON_OBJS:.o=.cc)
	
LIB_DIRS 	= /usr/lib
INC_DIRS 	= /usr/include
BIN_DIRS 	= /usr/bin

OMNI_LDFLAGS 	= -O2 -Wall -Wno-unused -fexceptions -Wno-deprecated
OMNI_LIBS  	= -lomniORB4 -lomnithread -lpthread

CC = g++
IDL = omniidl

$(CLIENT_NAME): $(COMMON_OBJS) $(CLIENT_OBJS)
	rm -f $@
	$(CC) $(OMNI_LDFLAGS) -L$(LIB_DIRS) $(OMNI_LIBS) -o $@ \
	$(COMMON_OBJS) $(CLIENT_OBJS)

$(CLIENT_OBJS): $(CLIENT_SRCS)
	rm -f $@
	$(CC) $(OMNI_LDFLAGS) -I. -I$(INC_DIRS) -c $(CLIENT_SRCS)

$(COMMON_OBJS): $(COMMON_SRCS)
	rm -f $@
	$(CC) $(OMNI_LDFLAGS) -I. -I$(INC_DIRS) -c $(COMMON_SRCS)

clean:
	rm -f *.o $(TARGETS)
